package com.bjsdzk.collector.entity;

import lombok.Getter;
import lombok.Setter;

public class Message implements Comparable<Message> {
	@Setter
	@Getter
	private String cmd;
	@Setter
	@Getter
    private int priority;
	@Setter
	@Getter
	private String source ;
	@Setter
	@Getter
	private String messageId ;
	@Setter
	@Getter
	private boolean callback =false ;
	@Setter
	@Getter
	private String devicePk  ;

	public Message(String cmd, int priority) {
		super();
		this.cmd = cmd;
		this.priority = priority;
	}

	public Message(String cmd, int priority, String source, String messageId, boolean callback) {
		this.cmd = cmd;
		this.priority = priority;
		this.source = source;
		this.messageId = messageId;
		this.callback = callback;
	}
	public Message(String cmd, int priority, String source, String messageId, boolean callback,String devicePk ) {
		this.cmd = cmd;
		this.priority = priority;
		this.source = source;
		this.messageId = messageId;
		this.callback = callback;
		this.devicePk = devicePk;
	}

	@Override
	public int compareTo(Message o) {
		return   o.priority - this.priority;

	} 
    
  
}  